package com.mcgrady.linear;

import org.junit.Test;

import java.sql.SQLOutput;
import java.util.Queue;
import java.util.Stack;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author McGrady
 */
public class StackQueueTest {
    @Test
    public void stack(){
        Stack<Integer> stack = new Stack();

        stack.push(32);
        stack.push(65);
        stack.push(98);

        System.out.println(stack.pop());
        System.out.println(stack.pop());

        System.out.println(stack.peek());
        System.out.println(stack);
    }

    @Test
    public void queue(){
        Queue<Integer> queue = new LinkedBlockingQueue<>();

        queue.add(64);
        queue.add(87);
        queue.add(23);

        System.out.println(queue.poll());
        System.out.println(queue.poll());

        System.out.println(queue.peek());
        System.out.println(queue);
    }
}
